<template>
    <van-form @submit="onSubmit">
        <h3 style="text-align: center;">小米账号登录</h3>
        <p  style="text-align: center;"><img src="@/assets/屏幕截图 2024-10-28 091756.png" alt=""></p>
        <p style="text-align: center;">让每个人都能享受科技的乐趣</p>
        <van-cell-group inset>
            <van-field v-model="username" name="" label="" placeholder="邮箱/手机号码/小米ID"
                :rules="[{ required: true, message: '请输入账号' }]" />
            <van-field v-model="password" type="password" name="" label="" placeholder="请输入密码"
                :rules="[{ required: true, message: '请输入登录密码' }]" />
        </van-cell-group>
        <div style="margin: 16px;">
            <van-button round block type="primary" native-type="submit" @click="$router.push('/')">
                登录
            </van-button>
            <p style="text-align: center; color: gray;" >手机号登录|立即注册|忘记密码？</p>
            <p style="text-align: center; color: gray; size: small;">其他方式登录</p>
<p style="text-align: center;"><img src="@/assets/屏幕截图 2024-10-28 092424.png" alt=""></p>
        </div>
    </van-form>
</template>
<script setup>
import request from '@/utils/request.js'
import {ref} from 'vue'
let username=ref('')
let password=ref('')
const onSubmit=(values)=>{
console.log(values);
if(request.data.code===200){
    alert('登录成功')
    router.push('/')
}else{
    alert('请输入正确的用户名和密码')
}

}
 
</script>